#include <stdio.h>

#define N 32

int main(void){
    int binary[N];
    int ind = 0, n;
    scanf("%d", &n);
    while(n){
        binary[ind++] = n & 1;
        n >>= 1;
    }
    for (int i = ind - 1; i >= 0; i--) 
        printf("%d ", binary[i]);

    printf("\n");
    return 0;
}
